﻿@model IEnumerable<IniTechCaash.Domain.Entities.ActivityLog>

@{
    ViewBag.Title = "Event Log";
}

<h2>Event Log</h2>

<table class="table table-condensed">
    <tr>
        <th>Username</th>
        <th>
            @Html.DisplayNameFor(model => model.LogDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Message)
        </th>
        <th>Reference Id</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CreatedBy)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LogDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Message)
        </td>
        @if (item.ObjectReferenceType == "Account")
        {
            <td>@Html.ActionLink("Account #" + item.ObjectReferenceId, "Details", "FinanceAccount", new { id = item.ObjectReferenceId }, null)</td>
        }
        else if (item.ObjectReferenceType == "JournalEntry")
        {
            <td>@Html.ActionLink("Journal Entry #" + item.ObjectReferenceId, "Details", "Journal", new { id = item.ObjectReferenceId }, null)</td>
        }
    </tr>
}

</table>
